package com.lifeng.common;

import lombok.Data;

@Data
public class Result<T>{
    private static final Integer SUCCESS = 1;
    private static final String SUCCESS_MSG = "交易成功";
    private Integer code;
    private String msg;
    private T data;

    public static Result success(){
        Result result = new Result();
        result.setCode(SUCCESS);
        result.setMsg(SUCCESS_MSG);
        return result;
    }
    public static Result success(Object data){
        Result result = new Result();
        result.setCode(SUCCESS);
        result.setMsg(SUCCESS_MSG);
        result.setData(data);
        return result;
    }
}
